Repository navigation
feat(contract-document): take an employmentId and load the contractor - #1327
Merged
jordividaller merged 7 commits intoSep 17, 2026
Merged
Conversation
Contributor
📦 Bundle Size Report
Size Limits
Largest Files (Top 5)
View All Files (471 total)
✅ Bundle size check passed |
Contributor
📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 575ba02. Configure here.
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
Picks up the projects endpoints and the v2 job-title eligibility check, and drops the removed GET engagement-agreement-details schema, which nothing in the SDK used. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…mmon `useGetContractDocuments` moves out of ContractorOnboarding so the standalone ContractDocument flow can share it, built on a `contractDocumentsOptions` factory. Same query key, same select; the old import path re-exports it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`employmentId` is now required by `ContractDocumentFlow` and `useContractDocument`, as it is for Invoice Schedule: consumers already know which contractor they act on, so the library ships no picker. The hook loads the employment and the contractor's existing contract documents and puts `employmentId`, `employment`, `isContractorOfRecord` and `contractDocuments` on the bag. `isLoading` stays true while the id is empty or either request is in flight, and nothing is requested for an empty id. Neither is rendered yet. A default MSW handler answers the contract-documents list with an empty list, so the onboarding tests that reach it behave as before. Part of pbyr-4777. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Termination, Invoice Schedule and the new Contract Document demo asked for an employment id with the same markup. One `EmploymentIdForm` now serves the three; labels and ids are unchanged so the E2E specs keep finding them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… response
The hey-api client does not throw on an error response, so a failed
GET /v1/employments/{id}/contract-documents resolved as a success and, through the `?? []`
select, read as "this contractor has no documents". The factory now throws on
`response.error`, as `countriesOptions` does, with `retry: false` like the employment
query, and `contractDocuments` stays `undefined` when the load failed.
Also: the WIP note in the README says the flow's props and bag may change between minor
versions until it is complete, the fixture carries `updated_at`, and the Termination demo
ignores an empty employment id like the other two demos.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
jordividaller
force-pushed
the
feat/pbyr-4777-contract-document-employment-id
branch
from
September 17, 2026 07:59
d0c9493 to
a3c1005
Compare
3 of 5 tasks
gabrielseco
approved these changes
Sep 17, 2026
…from common directly Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
jordividaller
deleted the
feat/pbyr-4777-contract-document-employment-id
branch
September 17, 2026 12:20
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Second part of the standalone ContractDocument flow (pbyr-4777), after #1319.
employmentIdis now required byContractDocumentFlowanduseContractDocument, as for Invoice Schedule: no contractor picker in the libraryemploymentId,employment,isContractorOfRecord,contractDocumentson the bag;isLoadingstays true while the id is empty or a request is in flight, and nothing is requested for an empty iduseGetContractDocumentsmoves tosrc/common/contract-documents/(own commit, re-exported at the old path) on acontractDocumentsOptionsfactoryEmploymentIdFormNothing is rendered from the loaded data yet. Next PR: the contract details form, built from
GET /v1/countries/{code}/contractor-contract-details?employment_id=…, whose schema now carries the prefill asdefaultvalues.🤖 Generated with Claude Code
Note
Low Risk
Mostly example/demo UX and regenerated client typings; consumers of removed engagement-agreement-details client exports may need to migrate to the v2 employment endpoint.
Overview
Contract document flow now requires a caller-supplied
employmentId(same pattern as invoice schedule):useContractDocumentloads that employment and existing contract documents and exposes them on the render bag; loading stays true until an id is set and requests finish. The contract-document example gates on a sharedEmploymentIdFormbefore mounting the flow and shows a minimal header (contractor name, Contractor of Record label).Example apps deduplicate employment-ID entry: Termination, Invoice Schedule, and Contract Document replace bespoke forms with
EmploymentIdForm(env-based defaults and custom submit labels unchanged).Generated API client is refreshed from the gateway: adds Projects list/get/patch and
POST …/job-title-eligibility-check, dropsGET /v1/countries/{code}/engagement-agreement-detailsand related exports, plus assorted new types (e.g.PayItemProviderDataParams).Reviewed by Cursor Bugbot for commit 42b9b5f. Bugbot is set up for automated code reviews on this repo. Configure here.